package com.example.yyjgit.tool;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import org.springframework.stereotype.Component;


/**
 * 根据手机号获取token
 */
@Component
public class TokenTool {
    public  String getToken1(String Phone){
        String token="";
        token= JWT.create().withAudience(Phone).sign(Algorithm.HMAC256(Phone));
        return token;
    }


    public String getToken(String EmailAddress){
        return JWT.create().withAudience(EmailAddress).sign(Algorithm.HMAC256(EmailAddress));
    }
}
